Skip to content

fix(mfa): Make MfaRequiredError extend AccessTokenError and privatize encrypt_mfa_token#104

Merged
kishore7snehil merged 1 commit intomainfrom
fix/mfa-breaking-changes
Apr 24, 2026
Merged

fix(mfa): Make MfaRequiredError extend AccessTokenError and privatize encrypt_mfa_token#104
kishore7snehil merged 1 commit intomainfrom
fix/mfa-breaking-changes

Conversation

@kishore7snehil
Copy link
Copy Markdown
Contributor

@kishore7snehil kishore7snehil commented Apr 24, 2026

Changes

  • MfaRequiredError now extends AccessTokenError instead of Auth0Error. Previously, get_access_token() could throw MfaRequiredError which would not be caught by existing except AccessTokenError handlers, silently breaking callers that rely on that pattern. Callers needing MFA-specific handling can catch MfaRequiredError before AccessTokenError.
  • Renamed encrypt_mfa_token to _encrypt_mfa_token since it is only called internally by ServerClient.get_access_token(). decrypt_mfa_token remains public as callers need it to unwrap tokens from MfaRequiredError.

… encrypt_mfa_token

MfaRequiredError now extends AccessTokenError so existing
except AccessTokenError handlers in get_access_token() callers
continue to work. Callers needing MFA-specific handling can catch
MfaRequiredError before AccessTokenError.

Renamed encrypt_mfa_token to _encrypt_mfa_token since it is only
called internally by ServerClient.get_access_token().
@kishore7snehil kishore7snehil requested a review from a team as a code owner April 24, 2026 11:03
@kishore7snehil kishore7snehil merged commit 69a018d into main Apr 24, 2026
9 checks passed
@kishore7snehil kishore7snehil deleted the fix/mfa-breaking-changes branch April 24, 2026 11:07
@kishore7snehil kishore7snehil mentioned this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants